package com.itheima.app;

import com.itheima.bean.Dog;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App1 {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext1.xml");
        Object cat = context.getBean("cat");
        System.out.println(cat);
        Dog dog = context.getBean(Dog.class);
        System.out.println(dog);

        String[] name = context.getBeanDefinitionNames();
        for(String beanName : name){
            System.out.println(beanName);
        }
    }
}
